package com.model;

public class Student extends Person {
	private String IdSV;
	private double math;
	private double physical;
	private double chemistry;
	
	public int size;
	
	public Student(String id, String name, int age){
		super(name, age);
		setIdSV(id);
	}
	
	private Student(String id, String name, int age, double math, double physical, double chemistry){
		super(name, age);
		setIdSV(id);
		setMath(math);
		setPhysical(physical);
		setChemistry(chemistry);
	}
	
	private Student(Person person, String id){
		super(person.getName(), person.getAge());
		setIdSV(id);
	}
	
	public String getIdSV(){
		return IdSV;
	}
	public void setIdSV(String id){
		this.IdSV = id;
	}
	
	public double getMath(){
		return math;
	}
	public void setMath(double math){
		this.math = math;
	}
	
	public double getPhysical(){
		return physical;
	}
	public void setPhysical(double physical){
		this.physical = physical;
	}
	
	public double getChemistry(){
		return chemistry;
	}
	public void setChemistry(double chemistry){
		this.chemistry = chemistry;
	}
	
	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}
	
	public String toString(){
		return this.getIdSV() + "\t" + this.getName() + "\t" + this.getAge()
				+ "\t" + this.getMath() + "\t" + this.getPhysical() + "\t" + this.getChemistry();
	}
	
	private String privateMethod(){
		return "This is private method with no parameter.";
	}
	
	private boolean updateInformation(Student student){
		
		try{
			setName(student.getName());
			setAge(student.getAge());
			setIdSV(student.getIdSV());
			setMath(student.getMath());
			setPhysical(student.getPhysical());
			setChemistry(student.getChemistry());
			return true;
		}
		catch(Exception ex){
			ex.printStackTrace();
			return false;
		}
	}
	
	private double calculateAverage(double math, double physical, double chemistry){
		return (math + physical +chemistry)/3;
	}

	
	
}
